<?php
/**
* Real Estate Collections delete
* @author: trungdt
* @since: Jan 25, 2011
* @version: 1.0
* 
* Change logs
* Jan 26, 2011 - trungdt - Add delete relative of pastor_subject
*/

if (!defined('EXPONENT')) exit('');

$subject = null;
if (isset($_GET['id'])) {
	$subject = $db->selectObject('rsnews_collections','id='.intval($_GET['id']));
}

if ($subject) {
	//$loc = unserialize($question->location_data);
	//if (exponent_permissions_check('manage_question',$loc)) {
    if ((exponent_users_isAdmin() || exponent_permissions_check('administrate',$loc))
     && exponent_users_isLoggedIn()){
		/**
        * WARNING: MUST REMOVE ALL RELATIVE items
        */
        //$db->delete('poll_answer','question_id='.$question->id);
        $db->delete("rsnews_collections","id = {$subject->id}");
		exponent_flow_redirect();
	} else {
		echo SITE_403_HTML;
	}
} else {
	echo SITE_404_HTML;
}

?> 
